import { http } from '@/utils/http.js'

/**
 * 查看物流
 */
export const logisticsApi = (id) => {
  return http.get(`/patient/order/${id}/logistics`)
}

/**
 * 药品订单列表
 */
export const getPatientMedicineOrderMylistApi = (
  status = 10,
  current = 1,
  pageSize = 10
) => {
  return http.get('/patient/medicine/order/mylist', {
    params: { status, current, pageSize },
  })
}

// 药品订单-查询订单详情信息
export const getPatientMedicineOrderDetailApi = (id) => {
  return http.request({
    method: 'GET',
    url: '/patient/medicine/order/detail/' + id,
  })
}

// 药品订单-根据处方下药品订单
export const postPatientMedicineOrderApi = (prescriptionId, addressId) => {
  return http.request({
    method: 'POST',
    url: '/patient/medicine/order',
    data: {
      id: prescriptionId,
      addressId,
    },
  })
}

// 预付订单信息
export const getPatientMedicineOrderPreApi = (prescriptionId) => {
  return http.request({
    method: 'GET',
    url: '/patient/medicine/order/pre',
    params: {
      prescriptionId,
    },
  })
}

// 药品订单-支付药款页面-根据处方信息计算药款
export const patientConsultPrescriptionApi = (id) => {
  return http.request({
    method: 'GET',
    url: '/patient/consult/prescription/' + id,
  })
}
